package com.lhyu.mall.utils;

import java.util.UUID;

/**
 * 生成UUID
 * 
 * @ClassName: Util
 * @Description: 为DB的主键生成唯一的UUID
 * @author lhl
 * @date 2019-5-20 上午11:56:00
 */
public class UUIDGenerator {

	public UUIDGenerator() {
	}


	public static String getUUID() {
		UUID uuid = UUID.randomUUID();
		String str = uuid.toString();
		// 去掉"-"符号
		String temp = str.substring(0, 8) + str.substring(9, 13)
				+ str.substring(14, 18) + str.substring(19, 23)
				+ str.substring(24);
		return temp;
	}
}
